﻿Imports System.Net

Public Class DownCore
    Inherits WebClient

    Property BytesReceived As Int32
    Property TotalBytesToReceive As Int32
    Property ProgressPercentage As Int32

    Public Sub Down()

        DownloadFileAsync(New Uri("http://dldir1.qq.com/qqfile/qq/QQ5.0/9857/QQ5.0.exe"),
                          "g:\1.exe")
    End Sub

    Private Sub DownCore_DownloadProgressChanged(sender As Object, e As DownloadProgressChangedEventArgs) Handles Me.DownloadProgressChanged
        BytesReceived = e.BytesReceived
        TotalBytesToReceive = e.TotalBytesToReceive
        ProgressPercentage = e.ProgressPercentage
    End Sub
End Class